/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author love2
 * @create 2019/4/5
 * @since 1.0.0
 */
package com.mayi.bootdemo.mapper;

import com.mayi.bootdemo.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {

    @Insert("insert into t_user(name,age,create_time,update_time) values(#{name},#{age},#{createTime},#{updateTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insertUser(User user);

    @Select("select id,name,age,create_time,update_time from t_user t")
    @Results({
            @Result(property = "createTime", column = "create_time"),
            @Result(property = "updateTime", column = "update_time")
    })
    List<User> findAllUser();
}
